package com.biostime.qdingding.modules.qd.dao;
import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.biostime.qdingding.common.mybatis.MyBatisDao;
import com.biostime.qdingding.common.persistence.CrudDao;
import com.biostime.qdingding.modules.qd.api.dto.MyCourseDto;
import com.biostime.qdingding.modules.qd.api.dto.MyCourseParamDto;
import com.biostime.qdingding.modules.qd.api.dto.CourseCalendarParamDto;
import com.biostime.qdingding.modules.qd.entity.Course;
import com.biostime.qdingding.modules.qd.entity.CourseOrder;
import com.biostime.qdingding.modules.qd.entity.Member;
import com.biostime.qdingding.modules.qd.entity.Student;


/**
 * 区域DAO接口
 * @author ThinkGem
 * @version 2014-05-16
 */
@MyBatisDao
public interface CourseOrderDao extends CrudDao<CourseOrder>{
	
	public CourseOrder getforcsId(CourseOrder courseOrder);
	
	/**获取课程排名**/
	public List<HashMap<String,String>> getRank(Course course);
	
	public List<MyCourseDto> getMyCourseListByWeek(CourseCalendarParamDto cd);
	public List<MyCourseDto> getMyCourseListByMonth(CourseCalendarParamDto cd);

	public List<CourseOrder> findOrderStudents(CourseOrder courseOrder);
	
	public List<CourseOrder> getCenterData(CourseOrder courseOrder);
	
	public List<CourseOrder> getCenterDatas(CourseOrder courseOrder);
	
	//<!-- ————————————————————————————楚河汉界，谁敢动我的，打死! ————————————————————————————————————-->	
	public List<Student> findByOrder();
	
	public String apiGetMaxOrderNoByReg(@Param("reg")String reg);
	
	public int apiCourseBook(@Param("courseId")String courseId,@Param("type")String type);
	
	public HashMap<String,Object> apiCourseOrder(@Param("courseId")String courseId,@Param("studentId")String studentId,@Param("type")String type);
	
	public HashMap<String,Object> apiCourseQueuing(@Param("courseId")String courseId,@Param("studentId")String studentId,@Param("type")String type);
	
	public int apiCourseQueue(@Param("courseId")String courseId,@Param("type")String type);
	
	public int apiOrderCourse(@Param("courseId")String courseId); 
		
	public int apiOrderCourse(CourseOrder courseOrder);
	
	public int apiChangeOrder(@Param("id")String id,@Param("state")String state);
	
	public CourseOrder apiGetTopWaiting(@Param("courseId")String courseId);
	
	public CourseOrder apiGetByStuAndCourse(@Param("courseId")String courseId,@Param("studentId")String studentId,@Param("type")String type);
	
	public List<CourseOrder> apiGetByStudent(@Param("studentId")String studentId,@Param("state")String state);
	
	public List<CourseOrder> apiGetWentCourse(@Param("studentId")String studentId); 
	
	public List<MyCourseDto> apiGetWentOrNot(MyCourseParamDto cd);
	
	public List<MyCourseDto> apiGetWent(MyCourseParamDto cd);
	
	public int apiCourseOrdAndQue(@Param("courseId")String courseId,@Param("type")String type);
	
	public List<CourseOrder> apiGetMyCourseOrder(Member member);
	
	public HashMap<String,Object> apiGetOrderId(@Param("courseId")String courseId,@Param("type")String type,@Param("studentId")String studentId);
	
	public List<CourseOrder> apiGetRecentCourder(@Param("studentId")String studentId);

	//获取免费体验次数
	public int getCouponCount(CourseOrder courseOrder);
}

